package week4.monday.two;

/**
 * @Package: week4.monday.two
 * @Author: yanjiali
 * @Created: 2024/3/18 21:46
 * 圆
 */
public class Circle extends Diagram{

    //对应园的半径
    private double radius;

    //Π
    private static final double PI = Math.PI;

    public Circle () {

    }

    public Circle(double radius) {
        this.radius = radius;
    }

    @Override
    public void draw() {
        super.draw();
    }

    /**
     * 计算面积
     * @return
     */
    public double getArea() {
        return Circle.PI * this.radius * this.radius;
    }

    public double getRadius() {
        return radius;
    }

    public void setRadius(double radius) {
        this.radius = radius;
    }

    public double getPI() {
        return PI;
    }
}
